home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
5_5.lha
/
5_5
/
main.c
< prev
next >
Wrap
Text File
|
1993-08-08
|
560b
|
37 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
har *strs[] =
"",
"1 ",
"2*3 ",
"2-3 ",
"5/2",
"123/4+123*4-3",
0
;
oid lookat(char *s)
cout << "x = '" << s << "'\n";
expr x(s);
cout << "x = "; x.print(); cout << "\n";
cout << "x = " << x.eval() << "\n";
cout << "\n";
ain(int argc, char **argv)
if (argc > 1)
while (*++argv)
lookat(*argv);
else
for (int i = 0; strs[i]; i++)
lookat(strs[i]);
return 0;